package com.dmlll.mapper;


import com.dmlll.VO.*;
import com.dmlll.domain.*;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author dmLll
 * @since 2021-03-31
 */
public interface DrugMessageMapper extends BaseMapper<DrugMessage> {

        List<DrugMessage> selectAll(DrugMessage drugMessage);

        /**
         * 药品目录
         */
        List<ZjsVO>selectCatalogue(
                @Param("serialNumber") String serialNumber,
                @Param("commonName") String commonName,
                @Param("dosageForm") String dosageForm,
                @Param("size") String size,
                @Param("unit") String unit,
                @Param("factor") Integer factor,
                @Param("category") String category
        );

        /**
         * 勾选导出药品目录
         */
        List<ZjsVO>selectByIdList(@Param("idList") Integer[] idList);

        /**
         * 查看详情
         */
        List<ZjsinformationVO>selectDrugInformation(
                @Param("serialNumber") String serialNumber,
                @Param("commonName") String commonName,
                @Param("dosageForm") String dosageForm,
                @Param("size") String size,
                @Param("unit") String unit,
                @Param("factor") Integer factor,
                @Param("productionName") String productionName,
                @Param("winPrice") Double winPrice,
                @Param("commodityName") String commodityName,
                @Param("winPriceMin") Double winPriceMin,
                @Param("winPriceMax") Double winPriceMax,
                @Param("category") String category,
                @Param("quality") Integer quality,
                @Param("transaction") Integer transaction
        );

        /**
         * 导出全部
         */
        List<ZjsinformationVO>selectZjsList();


        /**
         *根据采购目录查询
         */
        List<ZjsinformationVO>selectDrugInformationList(
                @Param("serialNumber") String serialNumber,
                @Param("commonName") String commonName,
                @Param("dosageForm") String dosageForm,
                @Param("size") String size,
                @Param("unit") String unit,
                @Param("factor") Integer factor,
                @Param("productionName") String productionName,
                @Param("winPrice") Double winPrice,
                @Param("commodityName") String commodityName,
                @Param("winPriceMin") Double winPriceMin,
                @Param("winPriceMax") Double winPriceMax,
                @Param("category") String category,
                @Param("quality") Integer quality,
                @Param("transaction") Integer transaction
        );

        /**
         * 批量添加(查询出需要添加的数据)
         */
        List<ProviderDrugCatalogControl> insertIdList(@Param("idList") Integer[] idList);

        /**
         * 添加
         */
        int insertPurchase(@Param("hospitalPurchaseCatalogs") HospitalPurchaseCatalog[] hospitalPurchaseCatalogs);

        /**
         *查询医院采购维护
         */
        List<ZjsinformationVO>selectMaintain(
                @Param("serialNumber") String serialNumber,
                @Param("commonName") String commonName,
                @Param("dosageForm") String dosageForm,
                @Param("size") String size,
                @Param("unit") String unit,
                @Param("factor") Integer factor,
                @Param("productionName") String productionName,
                @Param("winPrice") Double winPrice,
                @Param("commodityName") String commodityName,
                @Param("winPriceMin") Double winPriceMin,
                @Param("winPriceMax") Double winPriceMax,
                @Param("category") String category,
                @Param("quality") Integer quality,
                @Param("transaction") Integer transaction
        );


        /**
         * 根据ID删除医院采购目录维护
         */
        int delectMaintain(@Param("idList") Integer[] idList);

        /**
         * 勾选导出医院采购单维护目录
         */
        List<ZjsinformationVO>selectMaintainIdList(@Param("idList") Integer[] idList);

        /**
         * 查询供货商
         */
        List<Provider> selectProviderIdName();

        /**
         * 退货药品总查询
         */
        List<ZjsSalesReturnVO> selectSalesReturnCatalogue(@Param("zjsSalesReturnVO") ZjsSalesReturnVO zjsSalesReturnVO);

        /**
         * 查询退货单
         */
        List<ZjsGoodsNoteVO> selectGoodsNote(@Param("zjsGoodsNoteVO") ZjsGoodsNoteVO zjsGoodsNoteVO);

        /**
         * 添加退货单
         */
        int insertGoodsNote(HospitalOutput hospitalOutput);

        /**
         * 根据ID查询退货单ID
         */
        List<ZjsGoodsNoteVO> selectIdReturn(@Param("Sid") Integer Sid);

        /**
         *查询退货药品详细的信息
         */
        List<ZjsAddquantityVO>selectAddquantity(@Param("zjsAddquantityVO") ZjsAddquantityVO zjsAddquantityVO);

        /**
         *添加退货药品详细的信息
         */
        int insertAddquantity(@Param("hospitalOutputDetail")HospitalOutputDetail[] hospitalOutputDetail);

        /**
         *提交退货单信息
         * (修改退货单状态)
         */
         int updateQuantity(@Param("id") Integer id);

        /**
         * 查询出要添加的值
         * purchase_id，drug_message_id
         */
         List<PurchaseDrupDetail> selectInsertValue(@Param("idList")Integer[] idList);

        /**
         * 根据ID删除tuih单详细
         */
        int delectReturn(@Param("idList") Integer[] idList);

        /**
         * 查询结算单
         */
        List<ZjsFinalStatementVO> selectFinal(@Param("zjsFinalStatementVO") ZjsFinalStatementVO zjsFinalStatementVO);

        /**
         * 添加结算单
         */
        int insertFinal(HospitalClose hospitalClose);

        /**
         * 根据ID删除退货单内已添加的药品
         */
        int delectSalesDrug(@Param("idList") Integer[] idList);


        /**
         * 根据结算单查询药品
         */
        List<ZjsClearingDrugs>selectClearing(@Param("zjsClearingDrugs")ZjsClearingDrugs zjsClearingDrugs);

        /**
         * 根据结算单查询结算单详细
         */
         List<ZjsSelectClearingVO> selectFinalParticulars(@Param("id") Integer id);

        /**
         * 提交结算单
         * 修改结算单状态（close_state）
         */
        int updateCloseState(@Param("id") Integer id);

        /**
         * 删除结算单内已有的药品
         */
         int deleteFinalDrug(@Param("idList")Integer[] idList);
        //删除药品数据
        int deleteDrugidList(@Param("id") Integer id);

        /**
         * 采购单统计查询
         */
        List<ZjsPurchaseOrdersVO>selectPurchase(@Param("zjsPurchaseOrdersVO")ZjsPurchaseOrdersVO zjsPurchaseOrdersVO);

        /**
         * 勾选导出采购单统计
         */
        List<ZjsPurchaseOrdersVO>selectPurchaseByIdList(@Param("idList") Integer[] idList);

        /**
         * 供货商统计查询
         */
        List<ZjsSupplierVO>selectSupplier(@Param("zjsSupplierVO")ZjsSupplierVO zjsSupplierVO);

        /**
         * 勾选导出供应商统计
         */
        List<ZjsSupplierVO>selectSupplierByIdList(@Param("idList") Integer[] idList);

        /**
         * 查询医院信息
         * id，医院名称
         */
        List<Hospital> selectHospitalIdName();

        /**
         * 医院统计查询
         */
        List<ZjsHospitalStatisticsVO> selectHospitalStatistics(@Param("zjsHospitalStatisticsVO")ZjsHospitalStatisticsVO zjsHospitalStatisticsVO);

        /**
         * 勾选导出供应商统计
         */
        List<ZjsHospitalStatisticsVO>selectHospitalByIdList(@Param("idList") Integer[] idList);


        /**
         * 交易药品统计查询
         */
        List<ZjsDealStatisticsVO>selectDeal(@Param("zjsDealStatisticsVO")ZjsDealStatisticsVO zjsDealStatisticsVO);

        /**
         * 勾选导出交易药品统计
         */
        List<ZjsDealStatisticsVO>selectDealByIdList(@Param("idList") Integer[] idList);

}
